package org.example.slave.channel;

import io.netty.buffer.ByteBuf;

import java.net.SocketAddress;

/**
 * @author dingrui
 * @since 2022/2/16
 * @description
 */
public interface MyChannel {

    void write(byte[]... buf);

    byte[] read(int readSize);

    byte[] read(int readSize, long timeout);

    void read(byte[] data, int off, int len, long timeout);

    boolean isConnected();

    SocketAddress getRemoteSocketAddress();

    SocketAddress getLocalSocketAddress();

    void close();

    void writeCache(ByteBuf byteBuf);
}
